package com.apes.scm.account.account.repository;

import com.apes.framework.jpa.repository.CustomRepository;
import com.apes.scm.account.account.model.DetailOfFrozen;
import org.springframework.data.jpa.repository.Query;

public interface DetailOfFrozenRepository extends CustomRepository<DetailOfFrozen, Long> {
    @Query("select t from DetailOfFrozen t  where t.sourceBusinessType=?1 and t.orderNumber=?2 and t.orderSerialNumber=?3 and t.changeQty>0 and (t.changeQty-t.thawingQty)>0")
    DetailOfFrozen findBySource(String sourceType, String source, String sourceNumber);
}
